class Setting:
  def __init__(self):
      # 训练epochs数量
      self.EPOCHS = 10
      # 训练批大小
      self.BATCH_SIZE = 4
      # 输入的连续时间序列长度
      self.MAX_STEPS = 20
      # dropout随机失活比例
      self.DROPOUT_RATE = 0.3
      # 长短期记忆网络单元数
      self.LSTM_UNITS = 32
      # 正则化 - l2函数
      self.REGULARIZERS = 0.1
      # 数据集下载地址
      self.LOTTO_DOWNLOAD_URL = 'http://106.13.233.100:3002/getLimitData/4000'
      # 执行sql语句
      self.ExeQuery = 'http://106.13.233.100:3002/exeQuery?sql=select issueNo, five from issue_data order by issueNo ASC LIMIT 10000,3000'
      # 保存训练好的参数的路径
      self.CHECKPOINTS_PATH = 'checkpoints'
      # 预测下期号码时使用的训练好的模型参数的路径，默认使用完整数据集训练出的模型
      self.PREDICT_MODEL_PATH = '{}/model_checkpoint_x'.format(self.CHECKPOINTS_PATH)
      # 验证测试效果后，保存验证结果到文件中
      self.SavaDataFile = "_data.json"

      # 前区号码种类数
      self.FRONT_VOCAB_SIZE = 10
      # 前区需要选择的号码数量
      self.FRONT_SIZE = 5
      # 预测的时候，预测几注彩票,默认5注
      self.PREDICT_NUM = 5
      # 数据集路径
      self.DATASET_PATH = 'lotto.csv'

  def setDef(self,EPOCHS_=None,BATCH_SIZE_=None,MAX_STEPS_=None,FRONT_VOCAB_SIZE_=None,DROPOUT_RATE_=None,LSTM_UNITS_=None,FRONT_SIZE_=None,CHECKPOINTS_PATH_=None,LOTTO_DOWNLOAD_URL_=None,REGULARIZERS_=None,ExeQuery_=None,SavaDataFile_=None):
    self.EPOCHS = EPOCHS_ if EPOCHS_ else self.EPOCHS
    self.BATCH_SIZE = BATCH_SIZE_ if BATCH_SIZE_ else self.BATCH_SIZE
    self.MAX_STEPS = MAX_STEPS_ if MAX_STEPS_ else self.MAX_STEPS
    self.FRONT_VOCAB_SIZE = FRONT_VOCAB_SIZE_ if FRONT_VOCAB_SIZE_ else self.FRONT_VOCAB_SIZE
    self.DROPOUT_RATE = DROPOUT_RATE_ if DROPOUT_RATE_ else self.DROPOUT_RATE
    self.LSTM_UNITS = LSTM_UNITS_ if LSTM_UNITS_ else self.LSTM_UNITS
    self.FRONT_SIZE = FRONT_SIZE_ if FRONT_SIZE_ else self.FRONT_SIZE
    self.SavaDataFile = SavaDataFile_ if SavaDataFile_ else self.SavaDataFile
    self.CHECKPOINTS_PATH = CHECKPOINTS_PATH_ if CHECKPOINTS_PATH_ else self.CHECKPOINTS_PATH
    self.LOTTO_DOWNLOAD_URL = 'http://106.13.233.100:3002/getLimitData/{}'.format(LOTTO_DOWNLOAD_URL_) if LOTTO_DOWNLOAD_URL_ else self.LOTTO_DOWNLOAD_URL
    self.REGULARIZERS = REGULARIZERS_ if REGULARIZERS_ else self.REGULARIZERS
    self.ExeQuery = 'http://106.13.233.100:3002/exeQuery?sql=select issueNo, five from issue_data order by issueNo ASC LIMIT {}'.format(ExeQuery_) if ExeQuery_ else self.ExeQuery

    return self

if __name__ == '__main__':
  ss = Setting()
  print(ss)
  ss.setDef(MAX_STEPS_=40) 
  print(ss)